'Copyright (c) 2008, Jonathan Allen

Public Class QueueItem
    Inherits CatalogTitle

    Public Sub New(ByVal connection As NetflixConnection, ByVal source As XElement)
        MyBase.New(connection, source)
    End Sub

    Public ReadOnly Property Position() As Integer
        Get
            Return CInt(Source.<position>.Value)
        End Get
    End Property

    Public Overrides ReadOnly Property Id() As String
        Get
            Return Source.<id>.Value
        End Get
    End Property

    Public Overrides ReadOnly Property Title() As String
        Get
            Return Source.<title>.@regular
        End Get
    End Property

    Public Function TitleLink() As ResourceLink
        Return FindRelLink("http://schemas.netflix.com/catalog/title")
    End Function

    Public Function Series() As ResourceLink
        Return FindRelLink("http://schemas.netflix.com/catalog/titles.series")
    End Function

    Public ReadOnly Property QueueAvailablilityLink() As ResourceLink
        Get
            Return FindLink("available queue")
        End Get
    End Property

    Public ReadOnly Property Updated() As DateTime
        Get
            Return ClrExtensions.FromUnixTime(CLng(Source.<updated>.Value))
        End Get
    End Property
End Class
